<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Sisgo</title>

	<link href="${applicationProperties.rootPath}/css/jquery.dataTables.css" rel="stylesheet">
    <link href="${applicationProperties.rootPath}/css/bootstrap.css" rel="stylesheet">
    <link href="${applicationProperties.rootPath}/css/template.css" rel="stylesheet">
    <link href="${applicationProperties.rootPath}/css/general.css" rel="stylesheet">

</head>

<body>

	<%@ include file="../layout/globalTop.jsp" %>

    <div class="container">

		<fieldset>
		<legend>Paciente <a href="${applicationProperties.rootPath}/paciente/cadastrar"><img src="${applicationProperties.rootPath}/images/add.png" title="Adicionar Paciente" class="add"></a></legend>
		
		<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered data-table" width="100%">
		    <thead>
		        <tr>
		            <th width="38%">Nome</th>
		            <th width="8%">Sexo</th>
		            <th width="16%">Email</th>
		            <th width="18%">Telefone</th>
		            <th width="10%">Aniversario</th>
		            <th width="10%">Acoes</th>
		        </tr>
		    </thead>
		    <tbody>
		    	<c:forEach items="${patients}" var="patient">
		    		<tr>
		    			<td>${patient.name}</td>
		    			<td>${patient.gender}</td>
		    			<td>${patient.email}</td>
		    			<td>${patient.phone}</td>
		    			<td><fmt:formatDate value="${patient.birthDate}" pattern="dd/MM/yyyy" /></td>
		    			<td>
		    				<a href="${applicationProperties.rootPath}/paciente/alterar/${patient.id}"><img src="${applicationProperties.rootPath}/images/update.png" title="Editar Paciente" class="action"></a>
		    				<a href="${applicationProperties.rootPath}/paciente/excluir/${patient.id}"><img src="${applicationProperties.rootPath}/images/delete.png" title="Excluir Paciente" class="action"></a>
		    			</td>
		    		</tr>
		    	</c:forEach>
		    </tbody>
		    <tfoot>
		        <tr>
		            <th>Nome</th>
		            <th>Sexo</th>
		            <th>Email</th>
		            <th>Telefone</th>
		            <th>Aniversario</th>
		        </tr>
		    </tfoot>
		</table>
		
		</fieldset>

    </div><!-- /.container -->

    <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script src="${applicationProperties.rootPath}/js/jquery.dataTables.min.js"></script>
    <script src="${applicationProperties.rootPath}/js/bootstrap.min.js"></script>
	<script src="${applicationProperties.rootPath}/js/general.js"></script>
	<script src="${applicationProperties.rootPath}/js/patient/patient.list.js"></script>
  </body>
</html>
